#include "App_GetTempHum.h"
#include <stdlib.h>
#include <stdio.h>

void App_GetTempHum_Init(void)
{
    Inf_DHT11_Init();
}

char *App_GetTempHum_GetData()
{
    uint8_t hum = 0;
    float temp = 0;
    char *TempHum_str = malloc(30);
    Inf_DHT11_ReadTemperature(&hum, &temp);
    if(temp == 0 && temp == 0)
    {
        return NULL;
    }
    sprintf(TempHum_str, "T:%.1fC  Hum:%02d%%", temp, hum);
    return TempHum_str;
}
